package test;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;





public  class PropertyUtil {
	//添加日志输出
	static Log logger = LogFactory.getLog(PropertyUtil.class);
	public  static String getDirectory(){
		PropertyUtil test = new PropertyUtil();
		InputStream inputStream = test.getClass().getClassLoader()
				.getResourceAsStream("directory.properties");
		Properties p = new Properties();
		try {
			p.load(inputStream);
		} catch (IOException e1) {
			
			logger.error("getDirectory():"+e1.toString());
			//原来的代码
			//e1.printStackTrace();
		}
		String directory = p.getProperty("savePath");
		return directory;
	}

}
